package com.sandasai.action.admin;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.sandasai.service.AdminManager;
import com.sandasai.vo.PageBean;
@Controller
@Scope("prototype")
public class DeleteStudentInfoAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Resource
	private AdminManager adminManager;
	private int id;
	private PageBean pageBean;
	private int page;
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public PageBean getPageBean() {
		return pageBean;
	}
	public void setPageBean(PageBean pageBean) {
		this.pageBean = pageBean;
	}
	public String execute() throws Exception{
		if(adminManager.deleteStudent(id) == true){
			ActionContext ctx = ActionContext.getContext();
			pageBean=this.adminManager.queryForPageSt(10, page);
			ctx.put("message", "删除信息成功！！！");
			return SUCCESS;
		} else{
			ActionContext ctx = ActionContext.getContext();
			pageBean=this.adminManager.queryForPageSt(10, page);
			ctx.put("message", "删除信息失败！！！");
			return ERROR;
		}
	}
}
